class FetchLog < ActiveRecord::Base
  def self.last_fetched_at
    fetch_log = FetchLog.first
    fetch_log && fetch_log.last_fetched_at
  end

  def self.update_last_fetched_at
    fetch_log = FetchLog.first
    unless fetch_log
      fetch_log = FetchLog.new
    end
    fetch_log.last_fetched_at = Time.now
    fetch_log.save
  end
end
